#!/usr/bin/lua

require("apm4lua")
require("apm_global")
require("apm_log")
require("apm_frame")

-- 配置log
if G_VAR_FLAG_LOG == 1 then
	log_console = require "logging.console"
	logger = log_console();
else
	log_file = require "logging.rolling_file"
	local max_index      = 3
	local var_log_dir    ="../logs"
	local log_filename   = var_log_dir .. "/lua.log"
	os.execute("mkdir -p ".. var_log_dir);
	logger = log_file(log_filename, G_VAR_LOG_SIZE, max_index);
end

